﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JUtil;
using JUtil.Web.Extensions;

public partial class CSS_DualListBox_DualListBoxTest : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        InitListBox();
        RegisterEvent();
    }

    protected void InitListBox()
    {
        LLB.SelectionMode = ListSelectionMode.Multiple;
        RLB.SelectionMode = ListSelectionMode.Multiple;
    }

    protected void RegisterEvent()
    {
        MoveToR.Click += new ImageClickEventHandler(MoveToR_Click);
        AllToR.Click += new ImageClickEventHandler(AllToR_Click);
        AllToL.Click += new ImageClickEventHandler(AllToL_Click);
        MoveToL.Click += new ImageClickEventHandler(MoveToL_Click);
    }

    void MoveToL_Click(object sender, ImageClickEventArgs e)
    {
        RLB.MoveTo(LLB);
    }

    void AllToL_Click(object sender, ImageClickEventArgs e)
    {
        RLB.MoveAll(LLB);
    }

    void AllToR_Click(object sender, ImageClickEventArgs e)
    {
        LLB.MoveAll(RLB);
    }

    void MoveToR_Click(object sender, ImageClickEventArgs e)
    {
        LLB.MoveTo(RLB);
    }
}
